package com.example.demo.repository;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface RoleMapper {

    //0代表管理员 1代表普通用户 2代表游客
    @Insert("insert into role(username) values (#{username})")
    int insertOne(@Param("username") String username);

    @Select("select role from role r where r.username = #{username}")
    Integer selectOne(@Param("username") String username);
}
